/**
 * ===========================================
 * Project: gamehistory-web
 * ===========================================
 * Package: com.cyou.gamehistory.front.web
 * 
 * Copyright (c) 2012, CYOU All Rights Reserved.
 * ===========================================
 */
package com.cyou.gamehistory.front.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cyou.framework.pagination.proxy.PaginationSupport;
import com.cyou.gamehistory.entity.Game;
import com.cyou.gamehistory.service.GameService;

/**
 * <p>GameInfoController</p>
 *
 * @since 2012-12-16
 * @version 
 * @author zhangxingkai
 */
@Controller
@RequestMapping(value = "/f/game")
public class GameInfoController {
	
	@Autowired
	private GameService gameInfoService;
	
	@RequestMapping(value = "getGamesByInitial")
	@ResponseBody
	public PaginationSupport<Game> getGamesByInitial(String pinyin,String initial, int page) {
		return gameInfoService.getGamesByInitial(initial, page);
	}
	@RequestMapping(value = "getGamesByNameOrPinyin")
	@ResponseBody
	public List<Game> getGamesByNameOrPinyin(String condition) {
		return gameInfoService.search(condition);
	}

}
